<%@ page pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="taglib.jsp"%>
<header class="main-header">
	<a href="${ CONTEXT_PATH }/" class="logo"><span class="logo-mini"><img src="${IMG_LOGO}"></span><span class="logo-lg"><img src="${IMG_LOGO}"> ${APP_NAME}</span> </a>
	<nav class="navbar navbar-static-top" role="navigation">
		<div class="navbar-custom-menu">
			<ul class="nav navbar-nav">
				<c:if test="${ !loginUser.isGuest }">
					<li class="dropdown user user-menu"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="${IMG_USER_ICO}" class="user-image" alt="User Image"> <span
							class="hidden-xs">${ loginUser.name }</span> </a>
						<ul class="dropdown-menu">
							<li class="user-header"><img src="${IMG_USER_ICO}" class="img-circle" alt="User Image">
								<p>${ loginUser.name }</p></li>
							<li class="user-footer">
								<div class="pull-left">
									<a href="javascript:;" class="btn btn-default btn-flat">修改信息</a>
								</div>
								<div class="pull-right">
									<a id="btn-logout" href="javascript:;" class="btn btn-default btn-flat">退出登录</a>
								</div>
							</li>
						</ul></li>
				</c:if>
			</ul>
		</div>
	</nav>
</header>
<script>
	$(function() {
		$("#btn-logout").click(function() {
			$.get("${ CONTEXT_PATH }/logout", function() {
				$.removeCookie('_ticket_');
				location.href = "${ CONTEXT_PATH }/login";
			});
			window.setTimeout(function() {
				$.removeCookie('_ticket_');
				location.href = "${ CONTEXT_PATH }/login";
			}, 2000);
		});
	});
</script>